
***TEACHER RATED SKILLS AT 7

use "Data/NCDS/UKDA-5565-stata11/stata11/ncds0123.dta", clear
qui ds, not(varl "ncdsid serial number"|varl "1S*")
drop `r(varlist)'

* rename serial number
rename ncdsid  NCDSID  

* reading ability at 7 
rename n68 readingt_7
replace readingt_7=. if readingt_7<0

* creativity at 7 
rename n69 creativityt_7
replace creativityt_7=. if creativityt_7<0

* numeracy at 7 
rename n70	numeracyt_7
replace numeracyt_7=. if numeracyt_7<0

local vars7 creativityt numeracyt readingt

egen nMissingt=rowmiss(`vars7')
foreach v of local vars7 {
replace `v'_7=. if nMissingt>0
}
drop nMissingt

keep NCDSID *_7
sort NCDSID 

save scratchdata/ncds0123_teacherratedskills.dta, replace
